<?php

class tsw_thisMonthRain implements ThermdSingleWidget
{
  public function drawWidget($io,$x,$y)
  {	
    $black = imagecolorallocate($io,0,0,0);
		imagestring($io,1,$x,$y+4,"RAINFALL THIS MONTH",$black);
		imagestring($io,1,$x+24,$y+12,strtoupper(gmdate('F Y')),$black);
		$m_period = time()-gmmktime(0,0,0,gmdate('m'),1,gmdate('Y'));
		$thismonthrf = ThermdStats::ts_totalRainfallPeriod($m_period);
		if($thismonthrf===FALSE)
		{
			$thismonthrf = "-- ";
		}
		imagestring($io,4,$x+135,$y+3,$thismonthrf.ThermdStats::$rainunits,$black);
    $icon = imagecreatefrompng(ThermdStats::$thermosrc.'rain-last.png');

    imagecopy($io,$icon,$x+106,$y,0,0,24,24);
  }
}

?>